# -*- coding: utf-8 -*-
# @Time    : 2024/6/6 下午7:43
# @Author  : zhh
import json

import requests


class  RequestUtil:

    session = requests.Session()

    @staticmethod
    def send_request(method, url, data, **kwargs):
        method = str(method).lower()
        rep = None
        if method == 'get':
            rep = RequestUtil.session.request(method,url=url,data=data, **kwargs)
        else:
            data = json.dumps(data)
            rep = RequestUtil.session.request(method,url=url,data=data,**kwargs)
        return rep.text